<?php
namespace app\controllers;

use app\common\corelib\CacheHelper;
use app\logic\CommonLogic;
use app\logic\DeviceLogic;
use app\logic\UserLogic;
use Yii;


class DeviceController extends BaseController
{

	public function actionDeviceInfo(){
        $device_qrcode = $this->getQueryparams('scene',0);
        $deviceLogic = new DeviceLogic();
        $userLogic = new UserLogic();
        $device = $deviceLogic->getDevice($device_qrcode);
        $user = $userLogic->getUser($this->user_id);
        if($user){
            $device['current_num'] = $user->current_num;
        }else{
            $device['current_num'] = 0;
        }
        $this->response($device);
    }



}
